#增加导入render_template用于渲染模版
from flask import Flask, render_template
app=Flask(__name__)
@app.route("/")
def hello() -> str:
    return 'hello world from Flash!'
#接收post请求和get请求
@app.route("/search4",methods=['post','get'])
def do_search() -> str:
    return str(search4letters('life, the universe, and everything', 'eiru,!'))
@app.route("/entry")
def entry_page() -> 'html':
    return render_template('entry.html',the_title='WWH标题1')

def search4letters(strA:str, strB:str)->set:
    """查找字符串B中包含字符串A中的字母的集合"""
    return set(strA).intersection(set(strB))
#webapp调试模式运行,代码改变时自动重启webapp
app.run(debug=True)
